<?php

namespace backend\modules\system\controllers;

use yii;
use backend\controllers\BaseController;
use common\models\SysLog;
use yii\data\Pagination;

class LogController extends BaseController
{
    public $layout = '/agent';
	/**
	 * 系统日志
	 * @date: 2016-3-25 
	 * @author: futao
	 */
    public function actionIndex()
    {
    	$query = SysLog::find()
    	->where("log_type != 1");
    	$queryCount = clone $query;
    	$page = new Pagination(['totalCount' => $queryCount->count(),'pageSize' => $this->pageNavLimit]);
    	$list = $query
    	->offset($page->offset)
    	->limit($page->limit)
    	->orderBy('id desc')
    	->asArray()
    	->all();
    	return $this->render('log',['list'=>$list,'page'=>$page]);
    }
   
}
